package good.cglib;

import net.sf.cglib.proxy.Enhancer;

/**
 * AOP实现的第二种方法cglib
 */
public class Main {


    public static void main(String[] args) {
        CglibService cglibService=new CglibServiceImpl();
        CligProxy cligProxy = new CligProxy(cglibService);
        Enhancer enhancer =new Enhancer();
        enhancer.setSuperclass(CglibServiceImpl.class);
        enhancer.setCallback(cligProxy);

        CglibServiceImpl cglibService = (CglibServiceImpl) enhancer.create();
        cglibService.test("吃面条");


    }

}
